﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data.DataGet;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.ComponentModel;

namespace Business.DataBusiness
{
    public class DangNhapMK
    {
        _DangNhapMK data = new _DangNhapMK();
        private string userName;
        private string pass;


        public string UserName
        {
            get { return userName; }
            set { userName = value; }
        }
        
        public string Pass
        {
            get { return pass; }
            set { pass = value; }
        }
        public DangNhapMK() { }
        public DangNhapMK(string user, string pass1)
        {
            this.UserName = user;
            this.Pass = pass1;
        }
        public int Update()
        {
            return data.Update_MatKhau(this.UserName,this.Pass);
        }
        public int DangNhap()
        {
            return data.DangNhap(this.UserName,this.Pass).Rows.Count;
        }
        public int KiemTraMatKhau(string matkhaumoi, string matkhaulaplai, string user, string pass)
        {
            if ((matkhaumoi == matkhaulaplai) && (data.KiemTraMatKhau(user, pass) == 1))
                return 1;
            else
                return 0;
        } 
    }
}
